<div id="placeorder_main">
			<h3 style="color:white; padding:5px;">My Cart Place Order</h3>
			<div id="placeShop">
				<div id="placeOrderHolder">
					<?php
						$display = "";
						
						if(!isset($_SESSION['cart'])){
							
							$display = "Your cart is empty";
							echo $display;
							die();
						}
						if(count($_SESSION['cart']) <= 0 ){
							$display = "Your cart is empty";
							echo $display;
							die();
						}
						
						if(is_array($_SESSION['cart'])){
								
								$max = count($_SESSION['cart']);
								if($max>0){
									$display = '<form name="form1" method="post" >
									<input type="hidden" name="pid" />
									<input type="hidden" name="command" />
									<table name="placeOrderTable" id="placeOrderTable" border="" width="100%">
									<tr>
									<th>Name</th>
									<th>Categories</th>
									<th>Condition</th>
									<th>Brand</th>
									<th>Model</th>
									<th>Parts</th>
									<th>Price</th>
									<th>Stock Qty</th>
									<th>Qty</th>
									<th>Amount</th>
									<th>x</th>
								</tr>';
									;
									for($i=0; $i<$max; $i++){
										$pid = $_SESSION['cart'][$i]['productid'];
										$qty = $_SESSION['cart'][$i]['qty'];
										//echo $pid . "-" . $qty ."<>";
										$display .= displaycart($pid,$qty);
									
									}
									$display .="</tr> </table></form>";
									//$display .= '' ;
									echo $display;
								}
								else{
									$display = "You dont have any item in your cart";
								}
							}
						

						function displaycart($pid,$qty){
								$result=mysql_query("select * from tblswaping where id=$pid") or die("select name from products where id=$pid"."<br/><br/>".mysql_error());
								$display ="";
								$display .= "<tr>";
								//<div id="placeoderimg"><img id="placeoderimg"  src="images/vehicles/'.$row['filename'].'"/></div><br/>
								while($row = mysql_fetch_array($result)){
									
									$display .=	'<td valign="top" > <label> '. $row['name'] .' </label></td>';
									$display .= '<td valign="top" >'.$row['categories'].'</td>';
									$display .= '<td valign="top" >'.$row['conditions'].'</td>';
									$display .= '<td valign="top" >'.$row['brand'].'</td>';
									$display .= '<td valign="top" >'.$row['model'].'</td>';
									$display .= '<td valign="top" >'.$row['cparts'].'</td>';
									$display .=	'<td valign="top" > '. $row['price'] .' </td>  ';
									$display .=	'<td valign="top" > '. $row['quantity'] .' </td>  ';
									$display .=	' <td valign="top" ><input type="text" name="product'.$pid.'" id="qty" value="'.$qty.'" maxlength="3" size="2" "/></td>';
									$display .=	'<td valign="top" > '. $row['price'] * $qty .' </td>  ';	
									$display .=	'<td valign="top" ><a href="#" id="btndelete" name="'.$row['id'].'" onclick="del('.$pid.')" >x</a></td>';
									
									
								}
								
								return $display	;
						}

					?>
				</div>
			</div>
			<div id="placeShopBottom">	
				<div id="placeLeft">
					<?php echo $msg;?>
					</br>
					<label >Total:</label>
					<label id="lbltotal">P <?php echo get_order_total();?></label>&nbsp&nbsp&nbsp
					<input type="hidden" value="<?php $_SESSION['totalamount'] = get_order_total();?>" id="totalAmount" />
					<input type="button" value="Update Cart" onclick="update_cart()">
					<input type="button" value="Delete All" onclick="deleteallcart()">
				</div>
				
				<div id="placeRight">
					<button id="btnorder" value="order" id="order" onclick="redirect()" >order</button> 
					<button id="btnreserve" value="reserve" id="reserve" onclick="redirect()" >reserve</button> 
					
				</div>		
			</div>	
		</div><!--End of placeorder_menu-->
	